Crate async_compression
source · [−]Expand description
Adaptors between compression crates and Rust’s modern asynchronous IO types.
Feature Organization
This crate is divided up along two axes, which can each be individually selected via Cargo features.
All features are disabled by default, you should enable just the ones you need from the lists below.
If you want to pull in everything there are three group features defined:
Feature | Does |
---|---|
all | Activates all implementations and algorithms. |
all-implementations | Activates all implementations, needs to be paired with a selection of algorithms |
all-algorithms | Activates all algorithms, needs to be paired with a selection of implementations |
IO implementation
The first division is which underlying asynchronous IO trait will be wrapped, these are available as separate features that have corresponding top-level modules:
Feature | Type |
---|---|
futures-io | futures::io::AsyncBufRead , futures::io::AsyncWrite |
futures-bufread | (deprecated, use futures-io ) |
futures-write | (deprecated, use futures-io ) |
stream | (deprecated, see async-compression:stream docs for migration) |
tokio-02 | tokio::io::AsyncBufRead , tokio::io::AsyncWrite |
tokio-03 | tokio::io::AsyncBufRead , tokio::io::AsyncWrite |
tokio | tokio::io::AsyncBufRead , tokio::io::AsyncWrite |
Compression algorithm
The second division is which compression schemes to support, there are currently a few available choices, these determine which types will be available inside the above modules:
Feature | Types |
---|---|
brotli | BrotliEncoder , BrotliDecoder |
bzip2 | BzEncoder , BzDecoder |
deflate | DeflateEncoder , DeflateDecoder |
gzip | GzipEncoder , GzipDecoder |
lzma | LzmaEncoder , LzmaDecoder |
xz | XzEncoder , XzDecoder |
zlib | ZlibEncoder , ZlibDecoder |
zstd | ZstdEncoder , ZstdDecoder |
Modules
futures
futures-io
Implementations for IO traits exported by
futures
.Types which operate over
Stream
<Item =
io::Result
<
Bytes
>>
streams, both encoders and
decoders for various formats.tokio
tokio
Implementations for IO traits exported by
tokio
v1.0.tokio_02
tokio-02
Implementations for IO traits exported by
tokio
v0.2.tokio_03
tokio-03
Implementations for IO traits exported by
tokio
v0.3.Enums
Level of compression data should be compressed with.